package com.hall.service;

import com.hall.dao.DoctorAppraiseMapper;
import com.hall.pojo.DoctorAppraise;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.UUID;

@Service
public class DoctorAppraiseServiceImpl implements DoctorAppraiseService{
    @Autowired
    private DoctorAppraiseMapper doctorAppraiseMapper;
    @Override
    public void saveAppraise(DoctorAppraise doctorAppraise) {
        String id= UUID.randomUUID().toString().replaceAll("-", "");
        doctorAppraise.setId(id);
     doctorAppraiseMapper.insert(doctorAppraise);
    }

    @Override
    public void deleteAppriase(DoctorAppraise doctorAppraise) {
     doctorAppraiseMapper.delete(doctorAppraise);
    }

    @Override
    public DoctorAppraise findAppriaseId(String id) {
        return doctorAppraiseMapper.get(id);
    }

    @Override
    public List<DoctorAppraise> findCommentList(DoctorAppraise doctorAppraise) {
        return doctorAppraiseMapper.findList(doctorAppraise);
    }
}
